package com.fhzn.boss.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author 老顾
 * @apiNote 资源实体类
 * @since 2023/12/20
 */
@Data
@TableName("resource")
public class Resource extends BaseEntity {

    @TableId
    private Integer id;

    private String name;

    private String code;

    private String parentCode;

    private String resourceUrl;

    private Integer level;

    private Integer resourceType;

    private Integer sort;

    private String comment;

    private String icon;

    private Integer status;

    private String appCode;

    private String children;

    private String resourceExt;

    public boolean equals(Object o) {
        if (o instanceof Resource) {
            return StringUtils.equals(code, ((Resource) o).getCode());
        } else {
            return false;
        }
    }
}
